package com.zjbti.newfragment;

import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.fragment.app.ListFragment;

import android.app.Activity;
import android.os.Bundle;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        NewsListFragment fragment = new NewsListFragment();
        FragmentManager fm = getSupportFragmentManager();
        FragmentTransaction beginTransaction=fm.beginTransaction();
        beginTransaction.replace(R.id.ll,fragment);
        beginTransaction.commit();

    }
}